﻿
 <SCRIPT LANGUAGE="JAVASCRIPT"> 
function chck()
{  var  count=0;
   for (var i=0;i<form.length;i++)
   if ((form[i].type == "radio") && (form[i].checked))
   count++; 
   if (count==0)
      { return false;  }
   else
      { return true;   }
}
 
function Add(SourceList,TargetList)
	{
	var nIndex = SourceList.selectedIndex;
 	var nCount = 0;  
	if (nIndex == -1)
	{
		// Process continue only if at least one item selected
		//alert("请先选择一项!");
		return;
	}
	for (i=0;i<SourceList.length;i++)
  {
     if (SourceList.options(i).selected==true)
     {    
         if (inSouceList(SourceList.options(i).value,TargetList)==false)
         {
          	var objSelected = new Option(SourceList[i].text, SourceList[i].value);
           	TargetList.options[TargetList.length] = objSelected;
         }
     }     
	}
  for (var i=0;i<TargetList.options.length;i++)
  {
    TargetList.options(i).selected=true;
  }
	if(navigator.appName=="Netscape")
	{
		history.go(0)
	}
 }
 function inSouceList(SourceListOption,TargetList)
 {
 	  for (i=0;i<TargetList.length;i++)
    {
	     if (TargetList.options[i].value==SourceListOption)
       {
        	 return true;
       }
    }   
    return false;
 }  
function Remove(SelectList)
	{
	var nIndex = SelectList.selectedIndex;
 	var nCount = 0;
	if (nIndex == -1)
	{
		// Process continue only if at least one item selected
		//alert("请先选择一项!");
		return;
	}
  while(nCount<SelectList.length)
  {
       if (SelectList.options(nCount).selected==true)
       {
       	 SelectList.options[nCount] = null;
       }
       else
       {
         nCount++;
       }
  }
	if(navigator.appName=="Netscape")
		{
		history.go(0)
		}	
	}
 function enter()
 {
   var srcEle = window.event.srcElement;
   var tmp;   
   tmp = window.showModalDialog("pub_pub.Dialog_Date?vc_input=" + srcEle.value);
     if ( tmp.indexOf("/") != -1)
     {
        srcEle.value = tmp;
     }
     return;
 }   
 function check_num()
 {
 	 if (window.event.keyCode > 57 || window.event.keyCode < 48)
	 {
	 		window.event.returnValue = false;
	 }
 }
 function check_blank()
 {
 	 if (window.event.keyCode < 48)
	 {
	 		window.event.returnValue = false;
	 }
 }
  
function check_num_dot()
{
 	 if (window.event.keyCode > 57 || window.event.keyCode < 46)
	 {
  		 window.event.returnValue = false;   
	 }
   else
   {
      if(window.event.keyCode==47)
      {
    		 window.event.returnValue = false;
      }
      if(window.event.keyCode==46)
      {
         if (window.event.srcElement.value.indexOf(".")!=-1)
         {
        		 window.event.returnValue = false;
         }
      }   
    }  
 }
  
 function submitonce(theform)
 {
 if (document.all || document.getElementById)
 {
 for (i=0;i<theform.length;i++)
 {
 var tempobj = theform.elements[i]
 if (tempobj.type.toLowerCase() =="button")
 tempobj.disabled = true
 }
 }
 }
 
  function CheckAll() 
 {
   var i = 0;
   for (i=0; i < window.document.forms[0].elements.length; i++) 
   {
     if(window.document.forms[0].elements[i].Chk<3) 
     {
       if(window.document.forms[0].elements[i].value=="")
       {
         alert(window.document.forms[0].elements[i].alt);
         window.document.forms[0].elements[i].focus();
         return;
       }
       else if (window.document.forms[0].elements[i].Chk==2)
       {
         if (NotNumber(window.document.forms[0].elements[i].value))
         {
            alert("提示信息：\n不是有效的数字，请重新输入。");
            window.document.forms[0].elements[i].focus();
            return;
         }
       }
     }
     else if(window.document.forms[0].elements[i].Chk==3)
     {
       if(window.document.forms[0].elements[i].value!="")
       {
         if (NotNumber(window.document.forms[0].elements[i].value))
         {
            alert("提示信息：\n不是有效的数字，请重新输入。");
            window.document.forms[0].elements[i].focus();
            return;
         }
       }
     }
   }
   window.document.forms[0].submit();
   return true;
 }
 function NotNumber(Field)
 {
   var j = 0;
   var k = 0;
   for (var i=0; i<Field.length; i++)
   {
      var ch=Field.substring(i,i+1);
      if((ch>="0")&&(ch<="9")) 
      {
        j=0;
      }
      else if(ch==".") 
      {
        k++;
      }
      else
      {
        j=1;
        break;
      }
   }
   if ((j==0)&&(k<2))
   {
      return false;
   }
   else
   {
      return true;
   }
 }
 function openwindown(page)
 {
    window.open(page,"newuser","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=700,height=400,left=100,top=150");
 }
</SCRIPT>
 

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<link rel="stylesheet" href="css/style.css">
<script Language="JavaScript" src="css/pub_Calendar.js"></script>
<title>编制采购计划</title>
<SCRIPT LANGUAGE=javascript>
function abc(){
	var ll=document.getElementById("p_cgtype").value;
	var dis1=document.getElementById("gkqg");
	var dis2=document.getElementById("dxqg");
	
	if(ll==1){
		dis1.style.display="block";
		dis2.style.display="none";
	}else{
		dis2.style.display="block";
		dis1.style.display="none";
	}
}
      function submit_form(theForm,i)
      {
        document.form.action="Project_Save.asp";
        if ((document.form.p_gys_sel.options.length==0)&&
           (document.form.p_cgtype.value==2||
           document.form.p_cgtype.value==4||
           document.form.p_cgtype.value==5||
           document.form.p_cgtype.value==6||
           document.form.p_cgtype.value==7||
           document.form.p_cgtype.value==8||
           document.form.p_cgtype.value==11))
        {
           alert("请选择供应商。");
           return;
        }
       // if (form.p_input[5].value.length>400)
       // {
      //     alert("说明不能超过400字。");
       //    return;
       // }
        for (n=0;n<document.form.p_gys_all.options.length;n++)
        {
           document.form.p_gys_all.options(n).selected=true;
        }
        for (n=0;n<document.form.p_gys_sel.options.length;n++)
        {
           document.form.p_gys_sel.options(n).selected=true;
        }
        document.form.p_type.value=i;
	alert("采购计划报批成功！");
	window.location.href="Project_list.html";
        //CheckAll();
      }
      function select_cgtype(xyprice_null)
      {	
        document.form.action="Project_form.asp";
		
        if (document.form.p_cgtype.value==2||
            document.form.p_cgtype.value==4||
            document.form.p_cgtype.value==5||
            document.form.p_cgtype.value==6||
            document.form.p_cgtype.value==7||
            document.form.p_cgtype.value==8||
            document.form.p_cgtype.value==11)
        {
            document.form.add.disabled=false;
            document.form.del.disabled=false;
        }
        else
        {
            document.form.add.disabled=true;
            document.form.del.disabled=true;
        }
        if (xyprice_null=="True"&&document.form.p_cgtype.value==6)
        {
           alert("提示信息：\n物资对应的协议价格为空。\n请先维护供应商对应物资的协议价格后再编制协议采购的采购计划。");
           document.form.p_cgtype.value="1";
           document.form.add.disabled=true;
           document.form.del.disabled=true;
        }
        document.form.submit();
      }
      function back(i)
      {
        if (i==1)
        {
			window.location="../Order/Order_wbxjfa_list.asp?p_type=0";
         //  window.location="../Order/Order_wbxjfa_list.asp";
        }
        else if (i==2)
        {
           window.location="Project_list.asp?p_type=6";
        }
        else if (i==3)
        {
           window.location="../Order/Order_wbxjfa_list.asp?p_type=4";
        }
        else if (i==4)
        {
           window.location="../Order/Order_wbxjfa_list.asp?p_type=5";
        }
        else if (i==5)
        {
           window.location="../Order/Order_wbxjfa_list.asp?p_type=6";
        }
      }
</SCRIPT>
</head>
<body>
<center>

    <h2><font color=#0070C0>驳回采购计划明细</font></h2>

    <form name="form" action="Project_Save.asp" method="post">
 
<TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
<tr>
<td>
<table cellpadding="3" cellspacing="1" border="0" width="100%">

 <tr>
       <tr class="t1">
<td>采购计划编号</td>
      	<td>
      	1000201001251787
      	<input type="hidden" name="p_input" value="1000201001251787">      	</td>
<td><font color=red>采购计划名称</font></td>
      <td>20020055100109</td>      
</tr>
       <tr class="t1" >
<td>公司名称</td>
      	<td>
        株洲南车时代电气股份有限公司
      	<input type="hidden" name="p_input" value="1000">      	</td>
<td>编制人</td>
       <td>
       <input type="text" name="p_input" size="20"  readonly  maxlength="100" value="杨春"  Chk=1 alt="请输入编制人。">       </td>
</tr>
       <tr class="t1" >
<td>预算金额(元)</td>
       <td>
       <input type="text" name="p_input" size="20" maxlength="20" value="84360"  onKeyPress="check_num_dot()" Chk=3>       </td>
<td>采购计划编制时间</td>
       <td>2010/01/09</td>
</tr>
</table></td></tr></table>

<TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
<tr>
<td>
<table cellpadding="3" cellspacing="1" border="0" width="100%">

    <tr class="t1">
    <td nowrap align="center">序号</td>
    <td nowrap align="center">物资编码</td>
    <td nowrap align="center">物资名称</td>
    <td nowrap align="center">数量</td>
    
    <td nowrap align="center">计量<br>单位</td>
    <td nowrap align="center">交货期</td> 
    
       <td nowrap align="center">协议价格<br>（元）</td>
    
    <td nowrap align="center">预算总金额<br>（元）</td>
    <td nowrap align="center">计划价<br>（元/不含税）</td>
    <!--
    <td nowrap align="center">录入详细<br>交货情况</td>
    -->
    </tr>
 
       <tr class="t2" >
       <td align=center>1</td>
       <td >W64001005001<br></td>
       <td ><a href="../Project/print_order_detail.asp?p_type=1&p_orderno=1000201011133266&p_ordernum=1" target="_new" >晶振(HC-49U-500M-0.005%)</a><br></td>
       <td align=right><input type="text" name="p_input2" size="20"  readonly  maxlength="100" width=30 value="222"  Chk=1 alt="请输入编制人。">
         <br></td>
       
       <td align=center>个<br></td>
       <td align=center>2010/01/08<br></td>
       
            <td nowrap align="center"><a href="Xyprice_list.asp?itemcode=W64001005001"><br></td>       
       
       <td align=right><input type="text" name="p_input22" size="20"  readonly  maxlength="100" width=30 value="222"  Chk=1 alt="请输入编制人。">
         <br></td>
       <td align=right><br></td>
       <!--
       <td align="center"><a href="javascript:openwindown('../Project/Project_Delivery.asp?p_projno=1000201001251787&p_orderno=1000201011133266&p_ordernum=1')"><img src="../images/Open.gif" border="0" WIDTH="18" HEIGHT="12"></a></td>
       -->
       </tr>
 
</table></td></tr></table>

<TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
<tr>
<td>
<table cellpadding="3" cellspacing="1" border="0" width="100%">

 <tr  class="t1" >
 <td width=15% align="center"><font color=red>采购方式</font></td>
 <td colspan=3>

    <SELECT name="p_cgtype" Chk=1 alt="请选择采购方式。" onChange="abc()">
          <OPTION value="1" >公开求购</OPTION>
          <OPTION value="2" >定向询价</OPTION>
    </SELECT></td>
</tr>

  <input type="hidden" name="p_orderno" value="1000201011133266">
<tr  class="t1">
<td>满足条件的供应商列表</td>

<td align="center" colspan="3">
<div id="gkqg" style="display:block">
  <TABLE style="LINE-HEIGHT: 30px" cellSpacing=1 cellPadding=0     width="100%"  bgColor=#336699 borderColorLight=#006699 border=0>
	<tr class="t1">
		<th>
			<font color="black">供应商名称</font>		</th>
	</tr>
	<tr class="t2">
		<td>
			<div align="center">好又多			  </div></td>
	</tr>
	<tr class="t2">
		<td>
			<div align="center">多又好			  </div></td>
	</tr>
  </table>
  </div>
  
  <div id="dxqg" style="display:none">
  <table>
 <tr  class="t1" >
<td align="center">
<b>可选</b>
<br>
<select name="p_gys_all" size=15 style="width=160px" multiple>

   <OPTION value="12" >北京康特电子有限公司</OPTION>
</SELECT>
<td align="center" vAlign=center>

    <input type=button name="add" value="添加" onclick=Add(document.form.p_gys_all,document.form.p_gys_sel)>
    <p>
    <input type=button name="del" value="删除" onclick=Remove(document.form.p_gys_sel)>
</td>
<td align="center">
<b>已选</b>
<br>
<select name="p_gys_sel" size=15 style="width=160px" multiple>
</SELECT></td>
</tr>
</table>
</div></td>
<tr  class="t1" >
   <TD width="20%">财务部是否同意</TD>
          <TD class=t2>不同意</TD>
        </TR>
        <TR class=t1>
          <TD width="20%">财务部审核意见</TD>
          <TD class=t2>不同意</TD>
</tr>
<tr  class="t1" >
<td width=15% align="center" nowrap>说明：<br>（400字以内）</td>
<td colspan=3>
<TEXTAREA NAME="p_input" ROWS=3 COLS=77 style="width:100%">

</TEXTAREA></td>
</tr>
</table></td></tr></table>

<input type="hidden" name="p_projno" value="1000201001251787">
<input type="hidden" name="p_ftype" value="2">
<input type="hidden" name="p_type" value="">
<input type="hidden" name="p_listtype" value="">
<input type="hidden" name="p_title" value="">
<input type="hidden" name="p_Item" value="">
<input type="hidden" name="p_status" value="">
<input type="hidden" name="p_stocktype" value="">
<input type="hidden" name="page" value="">

<br>
<input type="button" value="报批" onClick="submit_form(document.form,1)">
    <input name="button" type="button" onClick="javascript:history.back ();" value="返回">
    </form>
<form name="form1" action="../Demand/xjfatz_gysxx.asp" method="post"target=_new>
<input type="hidden" name="p_suppsql" value="select * from Tb_ProjectSupp_Tmp where strProjCode='1000201001251787'">
</form>
</center>
</body>
</html>
